{extend name="list/list" /}
{block name="header"}

    <div class="pet_content pet_content_list pet_hd">
        <div class="pet_article_like">
            <div class="pet_content_main pet_article_like_delete">
                <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right pet_list_one_block">
                    <div class="pet_list_one_info">

                        <h1 class="am-list-item-hd pet_list_one_bt" style="text-align: center">
                            <a href="###" class="">{$data.name}</a>
                        </h1>
                        <div class="pet_list_one_info_l">
                            <div class="pet_list_one_info_name" style="width: 150px;margin-left: 266px;">原创:{$data.zuozhe} </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-4"></div>
                            <div class="col-xs-4"></div>
                            <div class="col-xs-4"><button type="button" class="btn btnshu " >加入书架</button></div>
                        </div>


                    </div>

                    <div class=" am-u-sm-8 am-list-main pet_list_one_nr" style="width: 100%;">
                        <div class="am-list-item-text pet_list_one_text" style="top: 35px">{$data.desc}</div>

                    </div>

                </li>
                <div data-am-widget="list_news" class="am-list-news am-list-news-default am-no-layout">
                    <div class="am-list-news-bd">
                        <ul class="am-list">
                            <!--缩略图在标题右边-->
                            {volist name="list" id="vo"}
                            <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right pet_hd_list" >
                                <a href="{:url('mobile/index/showcontent',['id'=>$vo.id])}" class="pet_hd_block" >
                                    <div class="pet_hd_block_tag"><span>{$vo.chapter}</span> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{$vo.name} </div>
                                </a>
                            </li>
                            {/volist}


                        </ul>

                    </div>

                </div>

            </div>

        </div>

        <div class="pet_article_footer_info">Copyright(c)2015 PetShow All Rights Reserved</div>
    </div>
<script>



    $(".btnshu").click(function () {
        var txt = $(".btnshu").text();
        if  (txt == "加入书架") {
            jiaru();
        } else{
            return false;
        }

    });

    // 加关注
    function jiaru() {
        $.ajax({
            type: 'post',
            url: "{:url('mobile/person/shujia')}",
            dateType: 'json',
            data: {
                "id": "{$data['id']}"
            },
            success: function ($data) {
                // console.log($data);
                if ($data.stat == 1) {
                    alert('加入成功');
                    $('.btnshu').html('已加入书架');
                } else if ($data.stat == 2) {
                    alert('FBI WARNING:加入失败！');
                } else if ($data.stat == 4) {
                    alert('FBI WARNING:小说已存在！');
                    $('.btnshu').html('已加入书架');
                } else {
                    alert('FBI WARNING:请先登录！');
                }
            },
            error: function () {
                alert('AJAX操作失败!');
            }
        });

    }


</script>
{/block}